﻿namespace EnergyGeneratorSimVisualizer.ViewModels
{
    using EnergyGeneratorSim.Parameters;

    /// <summary>
    /// View model for the inductor parameters
    /// </summary>
    public class InductorParametersViewModel : ViewModelBase
    {
        /// <summary>
        /// teh packing field of the inductor parameters class
        /// </summary>
        private InductorParameters inductorParameters;

        /// <summary>
        /// Initializes a new instance of the <see cref="InductorParametersViewModel"/> class.
        /// </summary>
        /// <param name="param">The param.</param>
        public InductorParametersViewModel(InductorParameters param)
        {
            this.inductorParameters = param;
        }

        /// <summary>
        /// Gets or sets the ninput.
        /// </summary>
        /// <value>The ninput.</value>
        public int Ninput
        {
            get
            {
                return this.inductorParameters.Ninput;
            }
            set
            {
                this.inductorParameters.Ninput = value;
                this.NotifyPropertyChanged(x => x.Ninput);
            }
        }         // Zahl der Wicklungen der Input-Spule

        /// <summary>
        /// Gets or sets the nturbo.
        /// </summary>
        /// <value>The nturbo.</value>
        public int Nturbo
        {
            get
            {
                return this.inductorParameters.Nturbo;
            }
            set
            {
                this.inductorParameters.Nturbo = value;
                this.NotifyPropertyChanged(x => x.Nturbo);
            }
        }           // Zahl der Wicklungen der Turbo-Spule

        /// <summary>
        /// Gets or sets the nebeninput.
        /// </summary>
        /// <value>The nebeninput.</value>
        public int Nebeninput
        {
            get
            {
                return this.inductorParameters.Nebeninput;
            }
            set
            {
                this.inductorParameters.Nebeninput = value;
                this.NotifyPropertyChanged(x => x.Nebeninput);
                this.Ninput = this.Nebeninput * this.Ueberinput;
            }
        }      // Windungen nebeneinander in der Input-Spule

        /// <summary>
        /// Gets or sets the ueberinput.
        /// </summary>
        /// <value>The ueberinput.</value>
        public int Ueberinput
        {
            get
            {
                return this.inductorParameters.Ueberinput;
            }
            set
            {
                this.inductorParameters.Ueberinput = value;
                this.NotifyPropertyChanged(x => x.Ueberinput);
                this.Ninput = this.Nebeninput * this.Ueberinput;
            }
        }      // Windungen uebereinander in der Input-Spule

        /// <summary>
        /// Gets or sets the nebenturbo.
        /// </summary>
        /// <value>The nebenturbo.</value>
        public int Nebenturbo
        {
            get
            {
                return this.inductorParameters.Nebenturbo;
            }
            set
            {
                this.inductorParameters.Nebenturbo = value;
                this.NotifyPropertyChanged(x => x.Nebenturbo);
                this.Nturbo = this.Nebenturbo * this.Ueberturbo;
            }
        }       // Windungen nebeneinander in der Turbo-Spule

        /// <summary>
        /// Gets or sets the ueberturbo.
        /// </summary>
        /// <value>The ueberturbo.</value>
        public int Ueberturbo
        {
            get
            {
                return this.inductorParameters.Ueberturbo;
            }
            set
            {
                this.inductorParameters.Ueberturbo = value;
                this.NotifyPropertyChanged(x => x.Ueberturbo);
                this.Nturbo = this.Nebenturbo * this.Ueberturbo;
            }
        }       // Windungen uebereinander in der Turbo-Spule

        /// <summary>
        /// Gets or sets the DD.
        /// </summary>
        /// <value>The DD.</value>
        public double DD
        {
            get
            {
                return this.inductorParameters.DD;
            }

            set
            {
                this.inductorParameters.DD = value;
                this.NotifyPropertyChanged(x => x.DD);
            }
        }
    }
}
